import asyncio

# 多携程-定义普通函数

def test(str:str):
    print(f'hello,{str}')
    return


# 定义异步函数，定义协程
async def test1():
    print('hello')
    # await asyncio.sleep(1)挂起当前协程，一秒钟，让别的协程执行
    await asyncio.sleep(1)
    print('world')
    return

# test('zhangsan')


coroutine = test1()
print(coroutine) # <coroutine object test1 at 0x00000231531459C0>
# 启动协程
print(asyncio.run(coroutine))
print(asyncio.run(test1()))